/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.spring.entidades;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Mabel
 */
@Entity
@Table(name = "registrador")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Registrador.findAll", query = "SELECT r FROM Registrador r"),
    @NamedQuery(name = "Registrador.findByIdRegistrador", query = "SELECT r FROM Registrador r WHERE r.idRegistrador = :idRegistrador"),
    @NamedQuery(name = "Registrador.findByApellidos", query = "SELECT r FROM Registrador r WHERE r.apellidos = :apellidos"),
    @NamedQuery(name = "Registrador.findByNombres", query = "SELECT r FROM Registrador r WHERE r.nombres = :nombres"),
    @NamedQuery(name = "Registrador.findByDireccion", query = "SELECT r FROM Registrador r WHERE r.direccion = :direccion"),
    @NamedQuery(name = "Registrador.findByPass", query = "SELECT r FROM Registrador r WHERE r.pass = :pass"),
    @NamedQuery(name = "Registrador.findByUser", query = "SELECT r FROM Registrador r WHERE r.user = :user"),
    @NamedQuery(name = "Registrador.findByEmail", query = "SELECT r FROM Registrador r WHERE r.email = :email"),
    @NamedQuery(name = "Registrador.findByFechac", query = "SELECT r FROM Registrador r WHERE r.fechac = :fechac"),
    @NamedQuery(name = "Registrador.findBySexo", query = "SELECT r FROM Registrador r WHERE r.sexo = :sexo")})
public class Registrador implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 8)
    @Column(name = "id_registrador")
    private String idRegistrador;
    @Size(max = 50)
    @Column(name = "apellidos")
    private String apellidos;
    @Size(max = 50)
    @Column(name = "nombres")
    private String nombres;
    @Size(max = 50)
    @Column(name = "direccion")
    private String direccion;
    @Size(max = 50)
    @Column(name = "pass")
    private String pass;
    @Size(max = 50)
    @Column(name = "user")
    private String user;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Correo electrónico no válido")//if the field contains email address consider using this annotation to enforce field validation
    @Size(max = 50)
    @Column(name = "email")
    private String email;
    @Size(max = 50)
    @Column(name = "fechac")
    private String fechac;
    @Size(max = 50)
    @Column(name = "sexo")
    private String sexo;
    @JoinColumn(name = "id_tipo", referencedColumnName = "id_tipoReg")
    @ManyToOne
    private TipoReg idTipo;

    public Registrador() {
    }

    public Registrador(String idRegistrador) {
        this.idRegistrador = idRegistrador;
    }

    public String getIdRegistrador() {
        return idRegistrador;
    }

    public void setIdRegistrador(String idRegistrador) {
        this.idRegistrador = idRegistrador;
    }

    public String getApellidos() {
        return apellidos;
    }

    public void setApellidos(String apellidos) {
        this.apellidos = apellidos;
    }

    public String getNombres() {
        return nombres;
    }

    public void setNombres(String nombres) {
        this.nombres = nombres;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFechac() {
        return fechac;
    }

    public void setFechac(String fechac) {
        this.fechac = fechac;
    }

    public String getSexo() {
        return sexo;
    }

    public void setSexo(String sexo) {
        this.sexo = sexo;
    }

    public TipoReg getIdTipo() {
        return idTipo;
    }

    public void setIdTipo(TipoReg idTipo) {
        this.idTipo = idTipo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRegistrador != null ? idRegistrador.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Registrador)) {
            return false;
        }
        Registrador other = (Registrador) object;
        if ((this.idRegistrador == null && other.idRegistrador != null) || (this.idRegistrador != null && !this.idRegistrador.equals(other.idRegistrador))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.spring.entidades.Registrador[ idRegistrador=" + idRegistrador + " ]";
    }
    
}
